# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=atomix
pkgver=3.34.0
pkgrel=2
pkgdesc="Build molecules out of single atoms"
url="https://wiki.gnome.org/Apps/Atomix"
arch=(loong64 x86_64)
license=(GPL2)
depends=(gtk3 libgnome-games-support)
makedepends=(meson appstream-glib git)
_commit=8494bab88eaf4325c395cca02379aa468b64b4ff  # tags/3.34.0^0
source=("git+https://gitlab.gnome.org/GNOME/atomix.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
  arch-meson $pkgname build
  ninja -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
